| 1 | '============================================================================================ | = | 1 | '============================================================================================ |
| 2 | ' ? Copyright, 2005-2008 MicroFour, Inc., All rights reserved. | 2 | ' ? Copyright, 2005-2008 MicroFour, Inc., All rights reserved. | |
| 3 | ' | 3 | ' | |
| 4 | ' This software and its associated documentation contain valuable trade secrets | 4 | ' This software and its associated documentation contain valuable trade secrets | |
| 5 | ' and proprietary information belonging to MicroFour, Inc. None of the software | 5 | ' and proprietary information belonging to MicroFour, Inc. None of the software | |
| 6 | ' or its associated documentation may be stored in a retrieval system, copied, | 6 | ' or its associated documentation may be stored in a retrieval system, copied, | |
| 7 | ' transmitted, distributed, transcribed or reproduced in any other way or disclosed | 7 | ' transmitted, distributed, transcribed or reproduced in any other way or disclosed | |
| 8 | ' to any third parties without the express written permission of MicroFour, Inc. | 8 | ' to any third parties without the express written permission of MicroFour, Inc. | |
| 9 | ' | 9 | ' | |
| 10 | ' UNDER NO CIRCUMSTANCES SHALL MICROFOUR, INC. BE LIABLE FOR INCIDENTAL, SPECIAL, | 10 | ' UNDER NO CIRCUMSTANCES SHALL MICROFOUR, INC. BE LIABLE FOR INCIDENTAL, SPECIAL, | |
| 11 | ' INDIRECT, DIRECT OR CONSEQUENTIAL DAMAGES OR LOSS OF PROFITS, INTERRUPTION OF | 11 | ' INDIRECT, DIRECT OR CONSEQUENTIAL DAMAGES OR LOSS OF PROFITS, INTERRUPTION OF | |
| 12 | ' BUSINESS, OR RELATED EXPENSES WHICH MAY ARISE FROM THE USE OF SOFTWARE OR DOCUMENTATION, | 12 | ' BUSINESS, OR RELATED EXPENSES WHICH MAY ARISE FROM THE USE OF SOFTWARE OR DOCUMENTATION, | |
| 13 | ' INCLUDING BUT NOT LIMITED TO THOSE RESULTING FROM DEFECTS IN SOFTWARE AND/OR DOCUMENTATION, | 13 | ' INCLUDING BUT NOT LIMITED TO THOSE RESULTING FROM DEFECTS IN SOFTWARE AND/OR DOCUMENTATION, | |
| 14 | ' OR LOSS OR INACCURACY OF DATA OF ANY KIND. | 14 | ' OR LOSS OR INACCURACY OF DATA OF ANY KIND. | |
| 15 | '-------------------------------------------------------------------------------------------- | 15 | '-------------------------------------------------------------------------------------------- | |
| 16 | ' ANY USE OF THIS CODE CONSTITUTES ACCEPTANCE OF THE TERMS OF THE COPYRIGHT NOTICE | 16 | ' ANY USE OF THIS CODE CONSTITUTES ACCEPTANCE OF THE TERMS OF THE COPYRIGHT NOTICE | |
| 17 | '-------------------------------------------------------------------------------------------- | 17 | '-------------------------------------------------------------------------------------------- | |
| 18 | ' DO NOT REMOVE THIS DISCLAIMER | 18 | ' DO NOT REMOVE THIS DISCLAIMER | |
| 19 | '============================================================================================ | 19 | '============================================================================================ | |
| 20 | 20 | |||
| 21 | Imports MicroFour.StrataFrame | 21 | Imports MicroFour.StrataFrame | |
| 22 | Imports MicroFour.StrataFrame.Business | 22 | Imports MicroFour.StrataFrame.Business | |
| 23 | Imports MicroFour.StrataFrame.Extensibility | 23 | Imports MicroFour.StrataFrame.Extensibility | |
| 24 | Imports System.ComponentModel | 24 | Imports System.ComponentModel | |
| 25 | Imports System.Drawing.Design | 25 | Imports System.Drawing.Design | |
| 26 | 26 | |||
| 27 | Namespace UI.Windows.Forms | 27 | Namespace UI.Windows.Forms | |
| 28 | 28 | |||
| 29 | <HideFromExtensibilityAttribute()> _ | 29 | <HideFromExtensibilityAttribute()> _ | |
| 30 | Public Class StandardForm | <> | 30 | Public Class StandardForm_wDXRibbon |
| 31 | Inherits MicroFour.StrataFrame.UI.Windows.Forms.BaseForm | 31 | Inherits MicroFour.StrataFrame.UI.Windows.Forms.BaseForm_wDXRibbon | |
| 32 | Implements ILocalizable | = | 32 | Implements ILocalizable |
| 33 | 33 | |||
| 34 | 34 | |||
| 35 | #Region " Declare Privates " | 35 | #Region " Declare Privates " | |
| 36 | 36 | |||
| 37 | Private _LocalizationKey As String = "" | 37 | Private _LocalizationKey As String = "" | |
| 38 | Private _PropertyToLocalize As String = "Text" | 38 | Private _PropertyToLocalize As String = "Text" | |
| 39 | 39 | |||
| 40 | #End Region | 40 | #End Region | |
| 41 | 41 | |||
| 42 | #Region " Event Handlers " | 42 | #Region " Event Handlers " | |
| 43 | 43 | |||
| 44 | Private Sub StandardForm_ConcurrencyException(ByVal e As Data.ConcurrencyExceptionEventArgs) Handles Me.ConcurrencyException | 44 | Private Sub StandardForm_ConcurrencyException(ByVal e As Data.ConcurrencyExceptionEventArgs) Handles Me.ConcurrencyException | |
| 45 | '-- Establish locals | 45 | '-- Establish locals | |
| 46 | Dim loForm As SoftCollisionDialog | 46 | Dim loForm As SoftCollisionDialog | |
| 47 | 47 | |||
| 48 | '-- Determine if the form needs to be shown | 48 | '-- Determine if the form needs to be shown | |
| 49 | If Me.AutoHandleCollisions Then | 49 | If Me.AutoHandleCollisions Then | |
| 50 | '-- Create the form | 50 | '-- Create the form | |
| 51 | loForm = New SoftCollisionDialog() | 51 | loForm = New SoftCollisionDialog() | |
| 52 | 52 | |||
| 53 | '-- Set the collision on the form | 53 | '-- Set the collision on the form | |
| 54 | loForm.Collision = e.Collision | 54 | loForm.Collision = e.Collision | |
| 55 | 55 | |||
| 56 | '-- Show the form and | 56 | '-- Show the form and | |
| 57 | If loForm.ShowDialog() = System.Windows.Forms.DialogResult.OK Then | 57 | If loForm.ShowDialog() = System.Windows.Forms.DialogResult.OK Then | |
| 58 | e.ResaveRecord = True | 58 | e.ResaveRecord = True | |
| 59 | Else | 59 | Else | |
| 60 | e.ResaveRecord = False | 60 | e.ResaveRecord = False | |
| 61 | End If | 61 | End If | |
| 62 | End If | 62 | End If | |
| 63 | End Sub | 63 | End Sub | |
| 64 | 64 | |||
| 65 | ''' <summary> | 65 | ''' <summary> | |
| 66 | ''' Set the localization for the form | 66 | ''' Set the localization for the form | |
| 67 | ''' </summary> | 67 | ''' </summary> | |
| 68 | ''' <param name="sender"></param> | 68 | ''' <param name="sender"></param> | |
| 69 | ''' <param name="e"></param> | 69 | ''' <param name="e"></param> | |
| 70 | ''' <remarks></remarks> | 70 | ''' <remarks></remarks> | |
| 71 | Private Sub StandardForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load | 71 | Private Sub StandardForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load | |
| 72 | MicroFour.StrataFrame.UI.Localization.SetLocalizationOnControl(Me) | 72 | MicroFour.StrataFrame.UI.Localization.SetLocalizationOnControl(Me) | |
| 73 | End Sub | 73 | End Sub | |
| 74 | 74 | |||
| 75 | #End Region | 75 | #End Region | |
| 76 | 76 | |||
| 77 | #Region " Localization Implementation " | 77 | #Region " Localization Implementation " | |
| 78 | 78 | |||
| 79 | ''' <summary> | 79 | ''' <summary> | |
| 80 | ''' The localization key used to retrieve the localization string for the localizable property on this | 80 | ''' The localization key used to retrieve the localization string for the localizable property on this | |
| 81 | ''' control | 81 | ''' control | |
| 82 | ''' </summary> | 82 | ''' </summary> | |
| 83 | ''' <value></value> | 83 | ''' <value></value> | |
| 84 | ''' <remarks></remarks> | 84 | ''' <remarks></remarks> | |
| 85 | <Category(LOCALIZATION_CATEGORY), _ | 85 | <Category(LOCALIZATION_CATEGORY), _ | |
| 86 | DefaultValue(""), _ | 86 | DefaultValue(""), _ | |
| 87 | Description("The localization key used to retrieve the localization string for the localizable property on this control."), _ | 87 | Description("The localization key used to retrieve the localization string for the localizable property on this control."), _ | |
| 88 | Editor(Constants.TE_LocalizationTypeEditor, GetType(UITypeEditor))> _ | 88 | Editor(Constants.TE_LocalizationTypeEditor, GetType(UITypeEditor))> _ | |
| 89 | Public Property LocalizationKey() As String Implements ILocalizable.LocalizationKey | 89 | Public Property LocalizationKey() As String Implements ILocalizable.LocalizationKey | |
| 90 | Get | 90 | Get | |
| 91 | Return _LocalizationKey | 91 | Return _LocalizationKey | |
| 92 | End Get | 92 | End Get | |
| 93 | Set(ByVal value As String) | 93 | Set(ByVal value As String) | |
| 94 | _LocalizationKey = value | 94 | _LocalizationKey = value | |
| 95 | End Set | 95 | End Set | |
| 96 | End Property | 96 | End Property | |
| 97 | 97 | |||
| 98 | ''' <summary> | 98 | ''' <summary> | |
| 99 | ''' The property that will be set according to the localization key | 99 | ''' The property that will be set according to the localization key | |
| 100 | ''' </summary> | 100 | ''' </summary> | |
| 101 | ''' <value></value> | 101 | ''' <value></value> | |
| 102 | ''' <remarks></remarks> | 102 | ''' <remarks></remarks> | |
| 103 | <Category(LOCALIZATION_CATEGORY), _ | 103 | <Category(LOCALIZATION_CATEGORY), _ | |
| 104 | DefaultValue("Text"), _ | 104 | DefaultValue("Text"), _ | |
| 105 | Description("The property that will be set according to the localization key"), _ | 105 | Description("The property that will be set according to the localization key"), _ | |
| 106 | Editor(Constants.TE_PropertyToLocalizeEditor, GetType(UITypeEditor))> _ | 106 | Editor(Constants.TE_PropertyToLocalizeEditor, GetType(UITypeEditor))> _ | |
| 107 | Public Property PropertyToLocalize() As String Implements ILocalizable.PropertyToLocalize | 107 | Public Property PropertyToLocalize() As String Implements ILocalizable.PropertyToLocalize | |
| 108 | Get | 108 | Get | |
| 109 | Return _PropertyToLocalize | 109 | Return _PropertyToLocalize | |
| 110 | End Get | 110 | End Get | |
| 111 | Set(ByVal value As String) | 111 | Set(ByVal value As String) | |
| 112 | _PropertyToLocalize = value | 112 | _PropertyToLocalize = value | |
| 113 | End Set | 113 | End Set | |
| 114 | End Property | 114 | End Property | |
| 115 | 115 | |||
| 116 | ''' <summary> | 116 | ''' <summary> | |
| 117 | ''' Determines if there is more than one property that needs localization | 117 | ''' Determines if there is more than one property that needs localization | |
| 118 | ''' </summary> | 118 | ''' </summary> | |
| 119 | ''' <value></value> | 119 | ''' <value></value> | |
| 120 | ''' <returns></returns> | 120 | ''' <returns></returns> | |
| 121 | ''' <remarks></remarks> | 121 | ''' <remarks></remarks> | |
| 122 | <Browsable(False)> _ | 122 | <Browsable(False)> _ | |
| 123 | Public ReadOnly Property HasAdditionalLocalizations() As Boolean Implements ILocalizable.HasAdditionalLocalizations | 123 | Public ReadOnly Property HasAdditionalLocalizations() As Boolean Implements ILocalizable.HasAdditionalLocalizations | |
| 124 | Get | 124 | Get | |
| 125 | Return False | 125 | Return False | |
| 126 | End Get | 126 | End Get | |
| 127 | End Property | 127 | End Property | |
| 128 | 128 | |||
| 129 | ''' <summary> | 129 | ''' <summary> | |
| 130 | ''' Attempts to set the localization on the property | 130 | ''' Attempts to set the localization on the property | |
| 131 | ''' </summary> | 131 | ''' </summary> | |
| 132 | ''' <param name="PropertyName"></param> | 132 | ''' <param name="PropertyName"></param> | |
| 133 | ''' <param name="LocalizedText"></param> | 133 | ''' <param name="LocalizedText"></param> | |
| 134 | ''' <returns></returns> | 134 | ''' <returns></returns> | |
| 135 | ''' <remarks></remarks> | 135 | ''' <remarks></remarks> | |
| 136 | Public Function SetLocalization(ByVal PropertyName As String, ByVal LocalizedText As String) As Boolean Implements ILocalizable.SetLocalization | 136 | Public Function SetLocalization(ByVal PropertyName As String, ByVal LocalizedText As String) As Boolean Implements ILocalizable.SetLocalization | |
| 137 | '-- Establish Locals | 137 | '-- Establish Locals | |
| 138 | Dim llReturn As Boolean = False | 138 | Dim llReturn As Boolean = False | |
| 139 | 139 | |||
| 140 | '-- See if the property is Text | 140 | '-- See if the property is Text | |
| 141 | If PropertyName.Equals("Text") Then | 141 | If PropertyName.Equals("Text") Then | |
| 142 | '-- Indicate the property was updated within this method | 142 | '-- Indicate the property was updated within this method | |
| 143 | llReturn = True | 143 | llReturn = True | |
| 144 | 144 | |||
| 145 | '-- Update the Text property | 145 | '-- Update the Text property | |
| 146 | Me.Text = LocalizedText | 146 | Me.Text = LocalizedText | |
| 147 | End If | 147 | End If | |
| 148 | 148 | |||
| 149 | '-- Return | 149 | '-- Return | |
| 150 | Return llReturn | 150 | Return llReturn | |
| 151 | End Function | 151 | End Function | |
| 152 | #End Region | 152 | #End Region | |
| 153 | 153 | |||
| 154 | End Class | 154 | End Class | |
| 155 | 155 | |||
| 156 | End Namespace | 156 | End Namespace |